/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.matrimonysite.sessionbean;

import com.matrimonysite.entity.AdvCustomer;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author khanhnguyen
 */
@Stateless
public class AdvCustomerFacade extends AbstractFacade<AdvCustomer> {
    @PersistenceContext(unitName = "MatrimonySite-ejbPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public AdvCustomerFacade() {
        super(AdvCustomer.class);
    }
    @Override
      public void create(AdvCustomer advcustomer) {
        em.persist(advcustomer);
    }

    @Override
    public void edit(AdvCustomer advcustomer) {
        em.merge(advcustomer);
    }

    @Override
    public void remove(AdvCustomer advcustomer) {
        em.remove(em.merge(advcustomer));
    }
}
